<template>
    <div class="conter">
        <div>
            <div style="text-align: center;font-size: 32px;color: #333333">{{details.cuNewsTitle}}</div>
            <div class="conter" style="width: 100%" v-html="details.cuNewsContent"></div>
            <div class="conter" style="width: 100%">
                <el-image :src="details.cuNewsCover"></el-image>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "news",
        data() {
            return {
                details:{}
            }
        },
        methods:{
            queryDetails(){
                this.$axios.post("NewsController/queryDetails", {cuNewsId: this.$route.params.code}).then((response) => {
                    if (response.data.code === 0) {
                        this.details = response.data.data;
                    }
                })
            }
        },
        mounted() {
            if (!this.$route.params.code) {
                this.$alert('<span style="vertical-align: middle;">非法进入</span> ', '提示', {
                    showCancelButton: false,
                    showConfirmButton: false,
                    dangerouslyUseHTMLString: true,
                    beforeClose: () => {

                    }
                });
            } else {
                this.queryDetails();
            }
        }
    }
</script>

<style scoped>

</style>
<style>
    .conter img {
        max-width: 100%;
    }
</style>